package StructuralMode.facade;

public class FacadeROOBO {
    private TV tv = new TV();
    private AirConditioner airConditioner = new AirConditioner();
    private Light light = new Light();

    public void allOn(){
        tv.on();
        airConditioner.on();
        light.on();
    }

    public void allOff(){
        tv.off();
        airConditioner.on();
        light.off();
    }

    public void voiceAssistant(String msg){
        switch(msg){
            case "打开电灯":
                light.on();
                break;
            case "关闭电灯" :
                light.off();
                break;
            case "打开空调":
                airConditioner.on();
                break;
            case "关闭空调":
                airConditioner.off();
                break;
            case "打开电视":
                tv.on();
                break;
            case "关闭电视":
                tv.off();
                break;
            default:
              System.out.println("暂时还听不懂您的意思");
        }
    }
}
